﻿@model PlmDailysupervisionViewModel
@{
    Layout = null;
    ViewBag.Title = "监理单位日报列表";
}

@*<form id="pagerForm" method="post" action="demo_page1.html">
        <input type="hidden" name="status" value="${param.status}">
        <input type="hidden" name="keywords" value="${param.keywords}" />
        <input type="hidden" name="pageNum" value="1" />
        <input type="hidden" name="numPerPage" value="${model.numPerPage}" />
        <input type="hidden" name="orderField" value="${param.orderField}" />
    </form>*@ @* <form onsubmit="return navTabSearch(this);" action="ylx_ctgl_px.html" method="post">*@
@using (Html.BeginForm("SplitPage", "PlmDailySupervision", null, FormMethod.Post, new { id = "pagerForm", onsubmit = "return navTabSearch(this);" }))
{
    <input type="hidden" name="pageNum" value="1" />
    <input type="hidden" name="numPerPage" value="@(ViewBag.numPerPage)" />
    <div class="searchBar">
        <table class="searchContent">
            <tr>
                @*<td>总监办：</td>
                        <td>
                            <select name="type" class="required combox">
                                <option value="YLZJ-1">YLZJ-1</option>
                                <option value="YLZJ-2">YLZJ-2</option>
                            </select>
                        </td>*@ @*<td>工作日期：</td>
                    <td>
                        <input type="text" class="date" name="time" value="@(ViewBag.time)" />
                    </td>
                    <td>
                        <button type="submit" class="btn btn-success btn-xs">搜索</button>
                    </td>*@
            </tr>
        </table>
    </div>
}
@*</form>*@
<div class="panelBar">
    <ul class="toolBar">
        @*<li>
                <a class="add" href="@Url.Action("DailySupervisionAdd", "PlmDailySupervision", new { target = "add" })" target="navTab" title="添加"><span>添加</span></a>


                </li>*@
        <li>
            @Html.PermissionButton("PersonnelLog.PlmDailySupervision.Create", "PersonnelLog_PlmDailySupervision_DailySupervisionAdd",
                    Url.Action("DailySupervisionAdd", "PlmDailySupervision", new { target = "add" }),
                    "添加",
                    new Dictionary<string, object>
                    {
                        {"class","add"} ,{"rel","jlrz_add"} ,{"mask","true"},{"target","dialog"},{"width","790"},{"height","660"},{"title","添加"}
                    })
        </li>
        <li>
            @Html.PermissionButton("PersonnelLog.PlmDailySupervision.Delete", "PersonnelLog_PlmDailySupervision_DailySupervisionDelete1",
                    Url.Action("DailySupervisionDelete", "PlmDailySupervision", new { workDate = "{sid_user}" }),
                    "删除",
                    new Dictionary<string, object>
                    {
                        {"class","delete"} ,{"mask","true"},{"title","确定要删除该条记录吗?"},{"target","ajaxTodo"}
                    })
        </li>
        <li>
            @Html.PermissionButton("PersonnelLog.PlmDailySupervision.Edit", "PersonnelLog_PlmDailySupervision_DailySupervisionEdit1",
                    Url.Action("DailySupervisionAdd", "PlmDailySupervision", new { target = "edit", id = "{sid_user}" }),
                    "修改",
                    new Dictionary<string, object>
                    {
                        {"class","edit"} ,{"rel","jlrz_edit"} ,{"mask","true"},{"target","dialog"},{"width","790"},{"height","660"},{"warn","请选择一条信息"}
                    })
        </li>
        <li>
            @Html.PermissionButton("PersonnelLog.PlmDailySupervision.Detail", "PersonnelLog_PlmDailySupervision_DailySupervisionDetail1",
                    Url.Action("DailySupervisionDetail", "PlmDailySupervision", new { workDate = "{sid_user}" }),
                    "查看",
                    new Dictionary<string, object>
                    {
                        {"class","detail"},{"rel","jlrz_add"} ,{"mask","true"},{"target","dialog"},{"width","790"},{"height","660"},{"warn","请选择一条信息!"}
                    })
        </li>
    </ul>
</div>
<table class="table" width="100%" layouth="77">
    <thead>
        <tr>
            <th align="center" style="display:none">
            </th>
            <th align="center">
                序号
            </th>
            <th align="center">
                标段号
            </th>
            <th align="center">
                工作日期
            </th>
        </tr>
    </thead>
    <tbody>
        <!--监理单位有编辑、删除权限，业主单位只有查看权限-->
        @{ int num = (ViewBag.pageNum - 1) * ViewBag.numPerPage;}
        @foreach (var item in Model.ThePlmDailysupervisionList)
        {
            num += 1;
            <tr target="sid_user" rel="@item.Ds_WorkDate.ToString("yyyy-MM-dd")">
                <td style="display:none">
                    <input name="ids" value="@item.Ds_WorkDate.ToString("yyyy-MM-dd")" type="checkbox">
                </td>
                <td>@num
                </td>
                <td>@(item.Ds_DirectorSection)
                </td>
                <td>@(item.Ds_WorkDate.ToString("yyyy-MM-dd"))
                </td>
            </tr>

        }
    </tbody>
</table>
<div class="panelBar" style="border-bottom: none;">
    <div class="pages" style="float: right">
        <span>显示</span>
        <select class="splitcombox" id="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
           <option value="10" @(ViewBag.numPerPage == 10 ? "selected='selected'" : "")>10</option>
                <option value="20" @(ViewBag.numPerPage == 20 ? "selected='selected'" : "")>20</option>
                <option value="50" @(ViewBag.numPerPage == 50 ? "selected='selected'" : "")>50</option>
        </select>
        <span>条，共@(ViewBag.pagenumshown)页,@(ViewBag.totalcount)条</span>
    </div>
    <div class="pagination" style="margin:0px;float:left; margin-left:35%" targettype="navTab" totalcount="@(ViewBag.totalcount)" numperpage="@(ViewBag.numPerPage)" pagenumshown="10" currentpage="@(ViewBag.pageNum)">
    </div>
</div>
@*<script>
        $.jTableTool.clickRowAction(function ($row) {
            if ($row) {
                var isDailyCheck = $row.data("dailycheck");
                var state = $row.data("state");
                if (isDailyCheck) {
                    //0=未上报得分，1=已上报得分
                    if (state != 0) {
                        //已经下发了
                        $("#SafetyConstruction_SafeAssessment_SafeAssessmentDelete").hide();
                        $("#SafetyConstruction_SafeAssessment_SafeAssessmentEdit").hide();
                    } else {
                        $("#SafetyConstruction_SafeAssessment_SafeAssessmentDelete").show();
                        $("#SafetyConstruction_SafeAssessment_SafeAssessmentEdit").show();
                    }
                }
            }
        });
    </script>*@ 